﻿namespace PropOnline.ViewModels.Tasacion
{
    using System.ComponentModel.DataAnnotations;
    using System.Web.Mvc;
    using PropOnline.Models;
    using PropOnline.Models.Validation;
    using PropOnline.Properties;
    using PropOnline.ViewModels.Shared;
    
    public class BusquedaTasacionViewModel : BusquedaViewModelBase
    {
        [Required(ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "CalleRequired")]
        [StringLength(50, MinimumLength = 2, ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "CalleStringLenght")]        
        public string Calle { get; set; }        
        
        [Range(0, 99999, ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "AlturaRange")]
        [Required(ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "AlturaRequired")]
        public int? Altura { get; set; }

        [RequiredIfTipoPropiedad("TipoPropiedad", ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "AmbientesRequired")]        
        [Range(1, 9, ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "AmbientesRange")]
        public int? Ambientes { get; set; }

        [Range(1, 999999, ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "SuperficieRange")]
        public int? Superficie { get; set; }

        public bool Dependencia { get; set; }

        public string Latitud { get; set; }

        public string Longitud { get; set; }
    }
}